package com.hmall.order.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.hmall.order.mapper.OrderMapper;
import com.hmall.order.pojo.Order;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderService extends ServiceImpl<OrderMapper, Order> implements IOrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Autowired
    private UserClient userClient;
public Order findById(Long id ){
    Order order = orderMapper.selectById(id);

    User user = userClient.getById(order.getUserId());
order.setUser(user);
return order;

}}
